﻿using ASmile.Com;
using ASmile.Com.Da;
using ASmile.Com.MDI;
using ASmile.DBModel;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ASmile.Web.ControllersApi.SysManage
{
    [Route("api/SysManage/[controller]/[action]")]
    [ApiExplorerSettings(GroupName = "SysManage")]
    public class MDIController : BaseApiController<MDIBLL>
    {
        /// <summary>
        /// 修改密码
        /// </summary>
        [HttpPost]
        [UserAuthorize(true, false)]
        public ApiResult ChangePwd(ArgChangePwd arg)
        {
            return BLLObj.ChangePwd(arg);
        }
        /// <summary>
        /// 根据角色获取菜单
        /// </summary>
        [HttpPost]
        [UserAuthorize(true, false)]
        public ApiResultList<Sys_RoleMenu> GetMenuByRole()
        {
            var rList = BLLObj.GetMenuByRole();
            return this.RetOK(rList, rList?.Count ?? 0, "OK");
        }        
        /// <summary>
        /// 验证密码
        /// </summary>
        [HttpPost]
        public ApiResult VerifyPwd(ArgId arg)
        {
            return BLLObj.VerifyPwd(arg.Id);
        }
    }
}